home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group94a.txt
/
000141_icon-group-sender _Thu May 5 16:22:56 1994.msg
< prev
next >
Wrap
Internet Message Format
|
1994-08-19
|
2KB
Received: by cheltenham.cs.arizona.edu; Tue, 24 May 1994 15:06:33 MST
Path: ucbvax!cis.ohio-state.edu!math.ohio-state.edu!sdd.hp.com!col.hp.com!csn!server!usenet
From: cheyenne@witsend.stortek.com (Cheyenne Wills)
Newsgroups: comp.lang.icon
Subject: Re: Spitbol vs. Icon
Message-Id: <CpC86B.K2C@stortek.com>
Date: 5 May 94 16:22:56 GMT
References: <1994May3.191711.12437@midway.uchicago.edu> <Cp8yyL.152@stortek.com> <1994May4.161502.9405@cs.rit.edu> <1994May5.012816.4786@midway.uchicago.edu>
Sender: usenet@stortek.com
Reply-To: cheyenne@witsend.stortek.com (Cheyenne Wills)
Organization: Storage Technology Corp.
Lines: 42
Nntp-Posting-Host: witsend.stortek.com
X-Newsreader: IBM NewsReader/2 v1.00
Apparently-To: icon-group@cs.arizona.edu
Status: RO
Errors-To: icon-group-errors@cs.arizona.edu
In <1994May5.012816.4786@midway.uchicago.edu>, goer@quads.uchicago.edu (Richard L. Goerwitz) writes:
>Nicolas M Williams writes:
>>
>>What about Icon library routines for handling regular expressions? I'd
>>love something like that, Icon would leave perl in the dust....
>
>Bob Alexander wrote some, and they're pretty good. They should be
>in recent library releases.
>
>--
>
> -Richard L. Goerwitz goer%midway@uchicago.bitnet
> goer@midway.uchicago.edu rutgers!oddjob!ellis!goer
Just a comment about regular expressions and Icon. One can view
regular expressions as an "assembly language" for a string matching
engine. They are extremely powerful, and also extremely "cryptic"
You can code the same "patterns" in straight Icon that will probably
run "faster".
For example:
"^[A-Z][A-Z0-9]* *[A-Z]*$"
can be "matched" by the following Icon segment
line ?
pos(1) &
any(&ucase) & move(1) &
tab(many(&ucase++&digits)) &
tab(many(' ')) &
tab(many(&ucase)) &
pos(0)
+--------------------------------------+---------------------------------+
| +-----+ | Cheyenne Wills |
| | | "From here on up it is | Storage Technology Corporation |
| | +--+--+ downhill all the way" | 2270 South 88th St. |
| | | | | | Louisville, Co. 80028-4232 |
| +--+--+ | These are not the | |
| | | opinions or views of | Cheyenne_Wills@stortek.com |
| +-----+ Storage Technology | cheyenne@witsend.stortek.com |
+--------------------------------------+---------------------------------+